<!doctype html>
<html>
    <head>
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
        <link rel="preload" href="/node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm" as="fetch" type="application/wasm" crossorigin="anonymous" />
        <link rel="preload" href="/node_modules/@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm" as="fetch" type="application/wasm" crossorigin="anonymous" />
        <link rel="preload" href="/node_modules/superstore-arrow/superstore.lz4.arrow" as="fetch" type="arraybuffer" crossorigin="anonymous" />
        <link rel="stylesheet" crossorigin="anonymous" href="/node_modules/@perspective-dev/viewer/dist/css/themes.css" />
        <script type="module">
            import "/node_modules/@perspective-dev/viewer/dist/cdn/perspective-viewer.js";
            import "/node_modules/@perspective-dev/viewer-datagrid/dist/cdn/perspective-viewer-datagrid.js";
            import "/node_modules/@perspective-dev/viewer-d3fc/dist/cdn/perspective-viewer-d3fc.js";

            import perspective from "/node_modules/@perspective-dev/client/dist/cdn/perspective.js";

            const worker = await perspective.worker();
            const resp = await fetch("/node_modules/superstore-arrow/superstore.lz4.arrow");
            const arrow = await resp.arrayBuffer();
            const viewer = document.getElementsByTagName("perspective-viewer")[0];
            const table = worker.table(arrow);
            viewer.load(table);
            viewer.restore({ settings: true, plugin_config: { edit_mode: "EDIT" } });
        </script>
        <style>
            perspective-viewer {
                position: absolute;
                top: 0;
                left: 0;
                bottom: 0;
                right: 0;
            }
        </style>
    </head>
    <body>
        <perspective-viewer></perspective-viewer>
    </body>
</html>
